ls = list(map(int, input().split()))
print(f"{ls[0]:4d}{ls[3]:4d}{ls[6]:4d}")
print(f"{ls[1]:4d}{ls[4]:4d}{ls[7]:4d}")
print(f"{ls[2]:4d}{ls[5]:4d}{ls[8]:4d}")